<!-- 客户详情-业务员 -->
<template>
  <div class="bussiness-manager">
    <tableTurn :tableData="getData" :args="args" ref="tableTurnRef">
      <a-table-column align="center" :width="80">
        <template #title> 序号 </template>
        <template #cell="{ rowIndex }">
          {{ rowIndex + 1 }}
        </template>
      </a-table-column>

      <a-table-column title="关联订单" dataIndex="number" align="center">
      </a-table-column>
      <a-table-column
        title="订单总价（人民币）"
        dataIndex="totalPrice"
        align="center"
      >
        <template #cell="{ record }">
          {{ `${record.totalPrice}` }}
        </template>
      </a-table-column>
      <a-table-column
        title="累计回款金额（人民币）"
        dataIndex="accumulatedCollectionPrice"
        align="center"
      >
      </a-table-column>
      <a-table-column
        title="未回款金额（人民币）"
        dataIndex="waitCollectionPrice"
        align="center"
      >
      </a-table-column>
    </tableTurn>
  </div>
</template>

<script lang="ts" setup>
  import { reactive, ref } from 'vue';
  import { GetClientOrder } from '@/api/order-management/client-order/index';
  import { useRoute } from 'vue-router';
  import { GetClientList } from '@/api/order-management/client-management/client-list';
  import dayjs from 'dayjs';

  const route = useRoute();
  let clientCompanyId = Number(route.query.id);

  const props = withDefaults(
    // 参数说明
    defineProps<{
      salesName: string;
    }>(),
    {}
  );

  // 表格配置
  const args = reactive({
    stripe: true,
    scroll: {
      y: 500,
    },
    bordered: {
      headerCell: true,
    },
  });

  // 获取数据
  const getData = async (pageData?: any) => {
    try {
      const res = await GetClientOrder({
        ...pageData,
        clientCompanyId,
      });
      return Promise.resolve(res);
    } catch (err: unknown) {
      console.log(err);
    }
  };
</script>

<style scoped lang="less"></style>
